<?

class graphDeviceIpv4Statistics extends graphBase {
	private $ipv4RrdPath ='';
	private $ipv6RrdPath ='';
	public function __construct(&$device,$params=array()) {
		$this->ipv4RrdPath = $device->getRrdPath().'ip_stats_ipv4.rrd';
		$this->ipv6RrdPath = $device->getRrdPath().'ip_stats_ipv6.rrd';
		parent::__construct($device,$params);
	}
	
	protected function getOptions() {
		return array(
			'DEF:InForwDatagrams_4='.$this->ipv4RrdPath.':InForwDatagrams:AVERAGE',
			'DEF:InDelivers_4='.$this->ipv4RrdPath.':InDelivers:AVERAGE',
			'DEF:InReceives_4='.$this->ipv4RrdPath.':InReceives:AVERAGE',
	  		'DEF:InDiscards_4='.$this->ipv4RrdPath.':InDiscards:AVERAGE',
			'DEF:OutForwDatagrams_4='.$this->ipv4RrdPath.':OutForwDatagrams:AVERAGE',
			'CDEF:OutForwDatagrams_4_n=OutForwDatagrams_4,-1,*',
			'DEF:OutRequests_4='.$this->ipv4RrdPath.':OutRequests:AVERAGE',
			'CDEF:OutRequests_4_n=OutRequests_4,-1,*',
			'DEF:OutDiscards_4='.$this->ipv4RrdPath.':OutDiscards:AVERAGE',
			'CDEF:OutDiscards_4_n=OutDiscards_4,-1,*',
			'DEF:OutNoRoutes_4='.$this->ipv4RrdPath.':InDiscards:AVERAGE',
			'CDEF:OutNoRoutes_4_n=OutNoRoutes_4,-1,*',
			'DEF:InForwDatagrams_6='.$this->ipv6RrdPath.':InForwDatagrams:AVERAGE',
			'DEF:InDelivers_6='.$this->ipv6RrdPath.':InDelivers:AVERAGE',
			'DEF:InReceives_6='.$this->ipv6RrdPath.':InReceives:AVERAGE',
			'DEF:InDiscards_6='.$this->ipv6RrdPath.':InDiscards:AVERAGE',
			'DEF:OutForwDatagrams_6='.$this->ipv6RrdPath.':OutForwDatagrams:AVERAGE',
			'CDEF:OutForwDatagrams_6_n=OutForwDatagrams_6,-1,*',
			'DEF:OutRequests_6='.$this->ipv6RrdPath.':OutRequests:AVERAGE',
			'CDEF:OutRequests_6_n=OutRequests_6,-1,*',
			'DEF:OutDiscards_6='.$this->ipv6RrdPath.':OutDiscards:AVERAGE',
			'CDEF:OutDiscards_6_n=OutDiscards_6,-1,*',
			'DEF:OutNoRoutes_6='.$this->ipv6RrdPath.':InDiscards:AVERAGE',
			'CDEF:OutNoRoutes_6_n=OutNoRoutes_6,-1,*',
				
			'LINE1.25:OutForwDatagrams_6#3F003F:            v6','GPRINT:OutForwDatagrams_6:LAST:%6.2lf%s','GPRINT:OutForwDatagrams_6:AVERAGE:%6.2lf%s','GPRINT:OutForwDatagrams_6:MAX:%6.2lf%s\n',
	
			'LINE1.25:OutForwDatagrams_4#AF63AF:OutForward  v4','GPRINT:OutForwDatagrams_4:LAST:%6.2lf%s','GPRINT:OutForwDatagrams_4:AVERAGE:%6.2lf%s','GPRINT:OutForwDatagrams_4:MAX:%6.2lf%s\n',
			'LINE1.25:InForwDatagrams_6#3F003F:            v6','GPRINT:InForwDatagrams_6:LAST:%6.2lf%s','GPRINT:InForwDatagrams_6:AVERAGE:%6.2lf%s','GPRINT:InForwDatagrams_6:MAX:%6.2lf%s\n',	
			'LINE1.25:InForwDatagrams_4#AF63AF:InForward   v4','GPRINT:InForwDatagrams_4:LAST:%6.2lf%s','GPRINT:InForwDatagrams_4:AVERAGE:%6.2lf%s','GPRINT:InForwDatagrams_4:MAX:%6.2lf%s\n',	
			'LINE:OutRequests_6_n#8080BD:            v6:STACK','GPRINT:OutRequests_6:LAST:%6.2lf%s','GPRINT:OutRequests_6:AVERAGE:%6.2lf%s','GPRINT:OutRequests_6:MAX:%6.2lf%s\n',
			'LINE:OutRequests_4_n#000033:OutRequests v4','GPRINT:OutRequests_4:LAST:%6.2lf%s','GPRINT:OutRequests_4:AVERAGE:%6.2lf%s','GPRINT:OutRequests_4:MAX:%6.2lf%s\n',
	
			'LINE:InReceives_6#91B13C:            v6:STACK','GPRINT:InReceives_6:LAST:%6.2lf%s','GPRINT:InReceives_6:AVERAGE:%6.2lf%s','GPRINT:InReceives_6:MAX:%6.2lf%s\n',
			'LINE:InReceives_4#003300:InReceives  v4','GPRINT:InReceives_4:LAST:%6.2lf%s','GPRINT:InReceives_4:AVERAGE:%6.2lf%s','GPRINT:InReceives_4:MAX:%6.2lf%s\n',
			'COMMENT:Packets/sec       Current  Average  Maximum\n',
		);
	}
}